<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <link rel="stylesheet" type="text/css" th:href="@{/static/layui-v2.6.13/layui/css/layui.css}"/>
  <script type="text/javascript" th:src="@{/static/layui-v2.6.13/layui/layui.js}"></script>
  <script type="text/javascript" th:src="@{/static/js/jquery-1.9.1.min.js}"></script>
</head>
<body>

<div class="layui-card">
    <div class="layui-card-header" align="center">商品类别表</div>
    <div class="layui-card-body">
        <div align="right">
            <button onclick="addtype()">添加</button>
        </div>
        <table class="layui-table">
            <thead>
            <tr>
                <td>id</td>
                <td>类名</td>
            </tr>
            </thead>
            <tbody>
            <tr th:each="type:${types}">
                <td th:text="${type.type}"></td>
                <td th:text="${type.name}"></td>
            </tr>
            </tbody>
        </table>
    </div>
</div>

</body>
<script>
    layui.use('layer',function(){
        var layer = layui.layer;
    });
    function addtype(){
          layer.open({
            type:2,
            area: ['650px','500px'],
            content:'toaddtype',
            end: function(){
              location.reload();
            }
          })
        }
</script>
</html>